In this guide, we will create an account on PythonAnywhere - a free Python hosting platform.
We will use it this platform to host a simple Python app that will help in the SSRF lab.
It should take few minutes, let's get started.
---------------------------------------
Step 1: Create Your Account
- Go to pythonanywhere.com
- Create a free account (Beginner account is sufficient)
- Verify your email
---------------------------------------
Step 2: Create a Web App
- Once logged in, go to the "Web" tab
- Click "Add a new web app"
- Click "Next" on the domain name screen (you'll get yourusername.pythonanywhere.com)
- Select "Flask" as the framework
- Choose Python 3.10 or latest available
- Keep the default path and click "Next"
---------------------------------------
Step 3: Replace the Default Code
Navigate to the "Files" tab.
Open: /home/yourusername/mysite/flask_app.py
Delete everything and paste this code:
from flask import Flask, redirect
app = Flask(__name__)
@app.route('/')
def redirect_to_localhost():
"""Redirect all requests to internal endpoints"""
return redirect('http://localhost:8080', code=302)
if __name__ == '__main__':
app.run()Click "Save" (or Ctrl+S).
---------------------------------------
Step 4: Reload Your App
- Go back to the "Web" tab
- Find the green "Reload" button
- Click it to restart your app
Your app is now live at:
https://yourusername.pythonanywhere.com
---------------------------------------
Step 5: Test the Redirect
Open your browser and visit your app URL.
Notice what happens - the redirect to localhost:8080.
see you in the next lecture.